import { DatePicker, Descriptions, Input, Table, Upload, Button } from 'antd';
import request from '@/http';
import React from 'react';
import { Form } from 'antd';
import { Link } from 'react-router-dom';
import All_style from '../../index.less';
const columns = [
  {
    /**无 */
    title: '操作人',
    dataIndex: 'person',
    key: 'person',
  },
  {
    title: '操作事项',
    dataIndex: 'operation',
    key: 'operation',
  },
  {
    title: '操作时间',
    dataIndex: 'operation_time',
    key: 'operation_time',
  },
  {
    title: '说明',
    dataIndex: 'explain',
    key: 'explain',
  },
];
const data = [];
const edit = (prop: any) => {
  const [data, setData] = React.useState({
    id: '',
    key: 1,
    studentName: '',
    studentNo: '',
    studentIdCard: '', //s身份证
    studentSex: '',
    studentEmail: '',
    studentTell: '',
    studentLogo: '',
    collegeName: '',
    majorName: '',
    gradeName: '',
    className: '',
    teacherName: '',
    teacherTell: '',
    src: '',
  });
  const loadData = async () => {
    //用户基本信息
    const result: any = await request.post(
      '/information/student/selectPersonalInfo',
    );
    if (result.success) {
      setData(result.data);
    }
  };
  return (
    <div className={All_style.box}>
      <Descriptions title="考勤详情">
        <Descriptions.Item label="姓名">{data.studentName}</Descriptions.Item>
        <Descriptions.Item label="学号">{data.studentNo}</Descriptions.Item>
        <Descriptions.Item label="身份证号">
          {data.studentIdCard}
        </Descriptions.Item>
        <Descriptions.Item label="性别">
          {data.studentSex === '1' ? '男' : '女'}
        </Descriptions.Item>
        <Descriptions.Item label="邮箱地址">
          {data.studentEmail}
        </Descriptions.Item>
        <Descriptions.Item label="手机号码">
          {data.studentTell}
        </Descriptions.Item>
        <Descriptions.Item label="院系">{data.collegeName}</Descriptions.Item>
        <Descriptions.Item label="专业">{data.majorName}</Descriptions.Item>
        <Descriptions.Item label="年级">{data.gradeName}</Descriptions.Item>

        <Descriptions.Item label="班级">{data.className}</Descriptions.Item>
        <Descriptions.Item label="班主任">{data.teacherName}</Descriptions.Item>
        <Descriptions.Item label="班主任电话">
          {data.teacherTell}
        </Descriptions.Item>
      </Descriptions>
      <Form>
        <Form.Item label="主题" name="title">
          <Input
            className={All_style.inserWorkInput}
            placeholder="选择主题"
            allowClear
          ></Input>
        </Form.Item>
        <Form.Item
          label="请假开始日期"
          name="begin_time"
          className={All_style.formItem}
        >
          <DatePicker className={All_style.select}></DatePicker>
        </Form.Item>
        <Form.Item
          label="请假结束日期"
          name="end_time"
          className={All_style.formItem}
        >
          <DatePicker className={All_style.select}></DatePicker>
        </Form.Item>
        <Form.Item label="上传附件" name="enclosure">
          <Upload></Upload>
        </Form.Item>
        <Form.Item label="操作记录" name="record">
          <Table columns={columns} className={All_style.table} />
        </Form.Item>
      </Form>
      <Link to="/Teacher/AttendanceRecord/index">
        <Button className={All_style.button2}>返回</Button>
      </Link>
    </div>
  );
};
export default edit;
